package com.candy.test;
import com.candy.service.AccountService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;


public class Client {

    @Test
    public  void test01() {
//        1、获取容器
        ClassPathXmlApplicationContext ac=new ClassPathXmlApplicationContext("beans.xml");
//        通过bean的id进行对象获取
        AccountService accountService= (AccountService) ac.getBean("accountServiceImpl");
        AccountService accountService2= (AccountService) ac.getBean("accountServiceImpl");
        System.out.println("对象是否指向同一内存");
        System.out.println(accountService==accountService2);
        ac.close();

    }



}
